<!-- 没用的文件 -->

{% extends "base.html" %}

{% block title %}查看回放 - 告警系统{% endblock %}

{% block extra_css %}
<style>
    .playback-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 */
        height: 0;
        overflow: hidden;
        border-radius: 10px;
        background-color: #000;
    }
    
    .playback-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .timeline-container {
        height: 100px;
        overflow-x: auto;
        background-color: #f8f9fa;
        border-radius: 8px;
        padding: 10px;
    }
    
    .timeline {
        display: flex;
        height: 80px;
    }
    
    .timeline-hour {
        flex: 1;
        border-right: 1px solid #dee2e6;
        position: relative;
    }
    
    .timeline-hour-label {
        position: absolute;
        bottom: -25px;
        left: 0;
        font-size: 0.8rem;
        color: #6c757d;
    }
    
    .timeline-event {
        position: absolute;
        background-color: rgba(231, 76, 60, 0.7);
        height: 30px;
        border-radius: 4px;
        cursor: pointer;
    }
</style>
{% endblock %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h1 class="fw-bold text-primary">查看回放</h1>
    <div class="btn-group">
        <button class="btn btn-outline-secondary">
            <i class="bi bi-download"></i> 下载录像
        </button>
        <button class="btn btn-outline-secondary">
            <i class="bi bi-camera"></i> 导出截图
        </button>
    </div>
</div>

<div class="row mb-4">
    <div class="col-md-9">
        <div class="card shadow-sm">
            <div class="card-header bg-primary text-white fw-bold d-flex justify-content-between align-items-center">
                <span>主入口通道 - 录像回放</span>
                <div class="btn-group">
                    <button class="btn btn-sm btn-light">
                        <i class="bi bi-zoom-in"></i>
                    </button>
                    <button class="btn btn-sm btn-light">
                        <i class="bi bi-zoom-out"></i>
                    </button>
                </div>
            </div>
            <div class="card-body p-0">
                <div class="playback-container">
                    <div class="d-flex justify-content-center align-items-center h-100">
                        <div class="text-center text-white">
                            <i class="bi bi-play-circle fs-1"></i>
                            <p class="mt-2">选择日期和时间查看回放</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="fw-medium">2025-07-08 14:30:00</div>
                    <div class="btn-group">
                        <button class="btn btn-outline-secondary">
                            <i class="bi bi-skip-backward"></i>
                        </button>
                        <button class="btn btn-outline-secondary">
                            <i class="bi bi-play"></i>
                        </button>
                        <button class="btn btn-outline-secondary">
                            <i class="bi bi-pause"></i>
                        </button>
                        <button class="btn btn-outline-secondary">
                            <i class="bi bi-skip-forward"></i>
                        </button>
                    </div>
                    <div class="fw-medium">2x</div>
                </div>
                <div class="mt-2">
                    <input type="range" class="form-range" min="0" max="100" value="45">
                </div>
            </div>
        </div>
    </div>
    
    <div class="col-md-3">
        <div class="card shadow-sm h-100">
            <div class="card-header bg-primary text-white fw-bold">录像列表</div>
            <div class="card-body p-0" style="max-height: 500px; overflow-y: auto;">
                <div class="list-group list-group-flush">
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">主入口通道</h6>
                                <small class="text-muted">2025-07-08 14:00 - 15:00</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">主入口通道</h6>
                                <small class="text-muted">2025-07-08 13:00 - 14:00</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">停车场通道</h6>
                                <small class="text-muted">2025-07-08 14:30 - 15:30</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">仓库通道</h6>
                                <small class="text-muted">2025-07-08 12:00 - 13:00</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">主入口通道</h6>
                                <small class="text-muted">2025-07-08 11:00 - 12:00</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                    <div class="list-group-item">
                        <div class="d-flex justify-content-between">
                            <div>
                                <h6 class="mb-0">办公区通道</h6>
                                <small class="text-muted">2025-07-08 10:00 - 11:00</small>
                            </div>
                            <span class="badge bg-primary">60分钟</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="card shadow-sm mb-4">
    <div class="card-header bg-primary text-white fw-bold">时间轴</div>
    <div class="card-body">
        <div class="mb-3">
            <label for="playbackDate" class="form-label">选择日期</label>
            <input type="date" class="form-control" id="playbackDate" value="2025-07-08">
        </div>
        
        <div class="timeline-container">
            <div class="timeline">
                <div class="timeline-hour">
                    <div class="timeline-hour-label">00:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">01:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">02:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">03:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">04:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">05:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">06:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">07:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">08:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">09:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">10:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">11:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">12:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">13:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">14:00</div>
                    <div class="timeline-event" style="left: 50%; width: 30%; top: 20px;"></div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">15:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">16:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">17:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">18:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">19:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">20:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">21:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">22:00</div>
                </div>
                <div class="timeline-hour">
                    <div class="timeline-hour-label">23:00</div>
                </div>
            </div>
        </div>
        
        <div class="mt-3 text-center">
            <div class="d-inline-block bg-danger me-2" style="width: 15px; height: 15px;"></div>
            <span class="me-3">报警事件</span>
            
            <div class="d-inline-block bg-success me-2" style="width: 15px; height: 15px;"></div>
            <span>运动检测</span>
        </div>
    </div>
</div>
{% endblock %}